package com.hmall.common.config;

import com.hmall.common.dto.Item;
import com.hmall.common.dto.PageDTO;

import com.hmall.common.feignFilter.MyFeignInterceptor;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

@FeignClient(value = "itemservice",configuration = MyFeignInterceptor.class)
public interface ItemFrignConfig {
    @GetMapping("/item/list")
    public PageDTO<Item> IpageController(@RequestParam("page") Integer page, @RequestParam("size") Integer size);
    //    新增商品
    @PostMapping
    public void postController(@RequestBody Item item);
    //    商品上下架
    @PutMapping("/item/status/{id}/{status}")
    public void putByIdOrStatus(@PathVariable("id")Long id,@PathVariable("status") Integer status);
    //    根据Id查询
    @GetMapping("/item/{id}")
    public Item getByIdController(@PathVariable("id")Long id);
    //    减库存
    @PutMapping("/item/stock/{itemId}/{num}")
    public void updateByItemId(@PathVariable("itemId")Long itemId,@PathVariable("num")Integer num);

    }
